<?php
namespace app\admin\validate;

use think\Validate;

/**
 * Class CustomerValidate
 * @package app\admin\validate
 */
class CustomerValidate extends Validate
{
    protected $rule = [
        'phone' => 'unique:edu_customer|require|regex:1[3-9]\d{9}',
    ];

    protected $message = [
        'phone.unique' => '手机号已存在',
        'phone.require' => '手机号不能为空',
        'phone.regex' => '手机号有误',
    ];

    protected $scene = [
        'add' => ['phone'],
        'edit' => ['phone'],
    ];
}